package model.altarica_fields;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;

public class Event {

    private String event;
    private ArrayList<String> event_vector;
    private HashMap<String, Event> lessEvents;
    private static final Event epsilon = new Event(" ");

    public static Event getEpsilon() {

        return epsilon;
    }

    public Event(String event) {

        this.event = event;
        this.event_vector = new ArrayList<String>();
        this.lessEvents = new HashMap<String, Event>();
    }

    public void addLessEvent(Event e) {

        lessEvents.put(e.getId(), e);
    }

    public Collection<Event> getLessEvents() {

        return lessEvents.values();
    }

    public String getId() {

        return event;
    }

    public boolean isEpsilon() {

        return this == epsilon;
    }

    @Override
    public String toString() {

        String str = "< " + event;
        for (String s : event_vector) {
            str = str + ", " + s;
        }
        return str + " >";
    }
}
